From: Florian Müllner Date: Wed, 21 Feb 2018 12:01:56 +0000 (+0100) Subject: tests: Fix gnome-shell theme import X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~994^2^2~11 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b7f083b1dace6d58893d2f40056cac54a8fc7741;p=gnome-shell.git tests: Fix gnome-shell theme import The current import rule fails in two ways: - commit c62e7a6a moved the theme's stylesheet to the builddir - since commit 49c4ba56, assets are addressed as resource:// URIs Fix both issues by loading and referencing the theme resource instead of the stylesheet itself. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/38 --- diff --git a/tests/run-test.sh.in b/tests/run-test.sh.in index 71b35aca0..ea6d15726 100755 --- a/tests/run-test.sh.in +++ b/tests/run-test.sh.in @@ -36,7 +36,7 @@ GJS_DEBUG_OUTPUT=stderr $verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG" GNOME_SHELL_TESTSDIR="$srcdir/" GNOME_SHELL_JS="$srcdir/../js" -GNOME_SHELL_DATADIR="$srcdir/../data" +GNOME_SHELL_DATADIR="$builddir/../data" export GI_TYPELIB_PATH GJS_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_TESTSDIR GNOME_SHELL_JS GNOME_SHELL_DATADIR LD_PRELOAD diff --git a/tests/testcommon/test.css b/tests/testcommon/test.css index a181c8a99..b82d2309b 100644 --- a/tests/testcommon/test.css +++ b/tests/testcommon/test.css @@ -1,4 +1,4 @@ -@import "../../data/theme/gnome-shell.css"; +@import url("resource:///org/gnome/shell/theme/gnome-shell.css"); stage { font: 16pt serif; diff --git a/tests/testcommon/ui.js b/tests/testcommon/ui.js index 51c136a39..df2655feb 100644 --- a/tests/testcommon/ui.js +++ b/tests/testcommon/ui.js @@ -14,6 +14,9 @@ const Environment = imports.ui.environment; function init(stage) { Environment.init(); + let themeResource = Gio.Resource.load(global.datadir + '/gnome-shell-theme.gresource'); + themeResource._register(); + let context = St.ThemeContext.get_for_stage(stage); let stylesheetPath = GLib.getenv("GNOME_SHELL_TESTSDIR") + "/testcommon/test.css"; let theme = new St.Theme({ application_stylesheet: Gio.File.new_for_path(stylesheetPath) });